/******************************************************************************
    File    :   Player.cs
    Version :   1.1.0.0
 	Date    :	16/11/2008   4:51
-------------------------------------------------------------------------------
*	Name    :	Nguyen Hung Cuong
*   Class   :   TH2005
*   StuID   :   0512085
*   Mail    :   nhc.hcmuns@gmail.com
-------------------------------------------------------------------------------
	Purpose :	
******************************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

namespace _512085_CaroChess
{
    /// <summary>
    /// Chess player
    /// </summary>
    public abstract class ChessPlayer
    {
        // player id
        protected byte _id;

        // player's chessmen
        protected List<ChessPiece> _chessPieces;

        public byte Id 
        {
            get { return _id; }
        }

        public List<ChessPiece> GetChessPieces()
        {
            return _chessPieces;
        }

        public ChessPlayer(byte id)
        {
            _id = id;
            _chessPieces = new List<ChessPiece>();
        }

        public bool IsExistChessMan(int x, int y)
        {
            foreach (ChessPiece chessMan in _chessPieces)
            {
                if (chessMan.X == x && chessMan.Y == y)
                    return true;
            }

            return false;
        }

        public abstract void Move(ChessGame game);
    }
}
